package com.test.springboot.springBootUtils.bean;

import lombok.Data;

/**
 * 接口数据统一返回
 * @author huyong
 *
 * @param <T>
 */
@Data
public class ResultVo<T> {
	/**
	 * 响应码
	 */
	private int code;
	/**
	 * 响应信息 用来说明响应情况
	 */
	private String msg;
	/**
	 * 具体响应信息
	 */
	private T data;

	public ResultVo(ResultCode resultCode, T data) {
		this.code = resultCode.getCode();
		this.msg = resultCode.getMsg();
		this.data = data;
	}

	public ResultVo(T data) {
		
		this(ResultCode.SUCCESS, data);
	}
}
